<!doctype html>
<html>
<head>
    <meta name="layout" content="main_index">
    <link rel="stylesheet" href="${resource(dir: 'css', file: 'occ.css')}" type="text/css">
    <g:javascript src="device.js" />
    <g:javascript src="occ.js" />
    <g:javascript src="device.details.js" />
    <script src="http://api.map.baidu.com/api?v=1.3"
            type="text/javascript"></script>
    <style>
        .init_ter_tab{
            border: 1px solid #cccccc;
            width:200px;
        }
        .init_ter_tab ,.init_ter_tab th,.init_ter_tab td{
            border-collapse:collapse;
            font-size:12px;border:1px solid #CAD9EA; padding:3px;margin:3px;
        }
        .ter_current{
            background-color: #FAFF72;
            border: 1px solid #CAD9EA;
            padding: 1px;
        }
    </style>
</head>
<body>
    <div region="west" style="width:150px;padding:10px 5px;"  class="tree-lines">
        <div style="padding:2px;position: relative;width:120px;height: 30px;">
            <a href="#" class=" client-add" title="添加" >添加</a>
            <a href="#" class=" client-update" title="修改">修改</a>
            <a href="#" class=" client-delete" title="删除">删除</a>
        </div>
        <ul id="tt" url="${createLink(action: 'areaTreeJson')}" animate="true" class="tree-lines"></ul>
    </div>
    <div id="content" region="center" style="padding:5px;border-left-width: 0;">
        <table id="client_tab" url="${createLink(action: 'listJson')}"></table>
        <div id="client_desc" url="${createLink(action: 'show')}"></div>
    </div>
<div id="add" style="padding:5px 10px">
    <g:form name="add_form" action="save" class="add_form">
        <g:render template="form"/>
    </g:form>
</div>

<div id="add_area" style="padding:5px 10px">
    <g:form name="add_area_form" action="saveArea" class="add_form">
        <g:hiddenField name="id" id="area_id"/>
        <g:hiddenField name="parentId"/>
        <div class="fieldcontain ">
            <label for="parentName">
                <g:message code="area.parentId.label" default="上级" />

            </label>
            <g:textField name="parentName"/>
        </div>
        <div class="fieldcontain ">
            <label for="area_name">
                <g:message code="area.name.label" default="名称" />

            </label>
            <g:textField name="name" id="area_name" class="easyui-validatebox" required="true"/>
        </div>
    </g:form>
</div>

<div id="device_query">
    <g:form name="add_area_query_form" action="listJson" controller="device" class="add_form">
        <div class="fieldcontain ">
            <label for="device_name">
                <g:message code="area.name.label" default="名称或编码" />

            </label>
            <g:textField name="device_name"/>
        </div>
    </g:form>
</div>

<div id="device_init_ter_dg">
    <div class="easyui-layout" style="height:300px;">

        <div region="west" style="width:100px;border-right-width: 0;">
            <ul id="device_init_ter_tree" class="easyui-tree" animate="true">

            </ul>
        </div>
        <div region="center" id="device_init_ter_center">

        </div>
    </div>

</div>

<g:include view="/device/details.gsp"></g:include>
<g:hiddenField name="deleteUrl" value="${createLink(uri: '/device/delete')}"/>
<g:hiddenField name="areaDeleteUrl" value="${createLink(uri: '/device/areaDelete')}"/>

<g:hiddenField name="devicesUrl" value="${createLink(uri: '/device/listJson')}"/>   \
<g:hiddenField name="formworkTreeDataUrl" value="${createLink(controller: 'device',action: 'formworkTreeData')}"/>

</body>
</html>
